package com.monkeyboy.model;


import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 用户对象 sys_user
 *
 * @author
 */
@Getter
@Setter
public class SysUser implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    private Integer userId;


    /**
     * 用户账号
     */
    private String userName;


    /**
     * 手机号码
     */
    private String phonenumber;
    /**
     * 密码
     */
    private String password;

    /**
     * 盐加密
     */
    private String salt;

    /**
     * 帐号状态（0正常 1停用）
     */
    private String status;


    public SysUser() {

    }

    public SysUser(Integer userId) {
        this.userId = userId;
    }

    public boolean isAdmin() {
        return isAdmin(this.userId);
    }

    public static boolean isAdmin(Integer userId) {
        return userId != null && 1 == userId;
    }
}
